package com.baoyi.pooke;

import android.app.WallpaperManager;
import android.graphics.Bitmap;
import android.widget.Toast;

import com.baoyi.adapter.LocImagesAdapter;

/**
 * 离线图片显示，最多显示50张图片
 * 
 * @author Administrator
 * 
 */
public class LocGalleryItem extends BaoyiGallery {

	@Override
	protected void setwallpaperManager() {
		Bitmap image = (Bitmap) adapter.getItem(selectIndex);
		try {
			final WallpaperManager wallpaperManager = WallpaperManager
					.getInstance(this);
			wallpaperManager.setBitmap(image);
			Toast.makeText(LocGalleryItem.this, "设置壁纸成功！", Toast.LENGTH_SHORT)
					.show();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	@Override
	protected void initAdapter() {
		adapter = new LocImagesAdapter(this);

	}

	@Override
	protected void oninitApp() {
		// TODO Auto-generated method stub

	}

}
